package com.ht.module.ai.controller;

import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import com.ht.config.log.annotation.SysLog;
import com.ht.module.ai.vo.AiChatVo;
import com.ht.module.sys.entity.SysUser;
import com.ht.util.JsonResult;
import com.ht.util.Pager;
import dev.langchain4j.model.chat.response.ChatResponse;
import dev.langchain4j.model.chat.response.StreamingChatResponseHandler;
import dev.langchain4j.model.ollama.OllamaChatModel;
import dev.langchain4j.model.ollama.OllamaStreamingChatModel;
import io.swagger.annotations.ApiOperation;
import nonapi.io.github.classgraph.json.Id;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.ht.module.ai.entity.AiChatSession;
import com.ht.module.ai.service.AiChatSessionService;
import com.ht.util.*;
import reactor.core.publisher.Flux;

import javax.annotation.Resource;
import javax.validation.Valid;


/**
 * <p>
 * AI聊天会话表 前端控制器
 * </p>
 *
 * @author hejialun
 * @since 2025-06-09
 */
@RestController
@RequestMapping("/ai-chat-session")
public class AiChatSessionController {
    @Resource
    private AiChatSessionService chatSessionService;





    @GetMapping("/findListByUser")
    @ApiOperation(value = "查询当前用户的会话")
    @SysLog(msg = "查询当前用户的会话")
    public JsonResult findListByUser(AiChatSession en){
        return JsonResult.success(chatSessionService.findListByUser(en));
    }


    @GetMapping("/getSessionId")
    @ApiOperation(value = "获取sessionId")
    @SysLog(msg = "获取sessionId")
    public JsonResult getSessionId(){
        return JsonResult.success(IdWorker.getId());
    }





}
